home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 October / macformat-005.iso / Shareware City / Developers / MacVogl-alpha1PPC / halloc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-11  |  331 b   |  24 lines  |  [TEXT/????]

  1.  
  2. #include <stdio.h>
  3.  
  4. extern    char    *malloc();
  5.  
  6. /*
  7.  * hallocate
  8.  *
  9.  *    Allocate some memory, barfing if malloc returns NULL.
  10.  */
  11. char *
  12. hallocate(size)
  13.     unsigned    size;
  14. {
  15.     char    *p;
  16.  
  17.     if ((p = (char *)malloc(size)) == (char *)NULL) {
  18.         fprintf(stderr,"hallocate: request for %d bytes returned NULL", size);
  19.         exit(1);
  20.     }
  21.  
  22.     return (p);
  23. }
  24.